Database systems can be used to maintain large amounts of data and other information. A typical database may include a number of tables for storing data. A particular data type must be specified for a table column and used for each associated row of the table. Constructed queries can be used to obtain information from the database. A query can include a set of instructions which can be used to combine, filter, or sort information contained in one or more tables of a database. Calculated columns can be added to a query to obtain a calculation result based on a formula and data in other columns of those tables or from external data sources, such as user-written code, linked files, and web services for example. Unfortunately, the associated calculation is performed each time the query is executed, and a user typically needs to define the same formula for the calculation multiple times (for example, once in each different query).